<%-- 
    Document   : ViewProduct
    Created on : Nov 21, 2012, 2:17:28 PM
    Author     : vupttse
--%>

<%@page import="assignment2.stub.Order"%>
<%@page import="assignment2.data.Products"%>
<%@page import="java.util.List"%>
<%@page import="java.util.List"%>
<%@page import="assignment2.stub.ProductsTbl_Stub"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Random"%>
<%@page import="java.util.Iterator"%>

<%@page import="java.util.Collection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Products</title>
        <link href="css/modern.css" rel="stylesheet">
        <link href="css/modern-responsive.css" rel="stylesheet">
        <link href="css/site.css" rel="stylesheet" type="text/css">

        <script src="js/jquery-1.8.2.min.js"></script>
        <script src="js/google-analytics.js"></script>
        <script src="js/github.info.js"></script>
        <script src="js/sharrre/jquery.sharrre-1.3.4.min.js"></script>
        <script src="js/carousel.js"></script>
        <script src="js/dropdown.js"></script>
        <script src="js/slider.js"></script>
        <script src="js/hover.js"></script>
        <script src="js/pagecontrol.js"></script>
        <script src="js/accordion.js"></script>
    </head>
    <body>
        <div class="page">
            <jsp:include page="Navigation.jsp"></jsp:include>
                <hr>


                <div class="page-control" data-role="page-control">
                    <ul>
                        <li class="active"><a href="#frame1">Shoes</a></li>
                        <li><a href="#frame2">Clothes</a></li>
                        <li><a href="#frame3">Collections</a></li>
                        <li><a href="#frame4">Sale off</a></li>                    
                    </ul>
                    <!--Tab content-->
                    <div class="frames">
                        <!--Frame1-->
                        <div class="frame active bg-color-blueLight fg-color-purple" id="frame1">                        
                            <div class="page-region">
                                <div class="page-region-content" style="height: 100%">
                                    <div class="grid" style="padding-left: 10px">
                                        <div class="row">
                                        <%
                                            Object ob = session.getAttribute("orders");
                                            if (ob == null) {
                                                List<Order> orders = null;
                                                session.setAttribute("orders", orders);
                                            }
                                            String categoryID = "1";
                                            ProductsTbl_Stub productsTbl_Stub = new ProductsTbl_Stub();
                                            List<Products> list1 = productsTbl_Stub.listByCategoryID(categoryID);
                                            Iterator<Products> it = list1.iterator();
                                            while (it.hasNext()) {
                                                Products entity = it.next();
                                        %>
                                        <div>
                                            <table id="product" class="span3 hovered border-color-red"  style="margin-left: 0px;margin-bottom: 20px; margin-top: 20px;">
                                                <tr>
                                                    <td colspan="2">
                                                        <a href="ViewProductDetails.jsp?productId=<%=entity.getProductID()%>">
                                                            <img src=<%=entity.getProductImage()%> class="imgOpa" height="160px" width="160px"></a>
                                                    </td>                                            
                                                </tr>
                                                <tr>
                                                    <td>ID: </td><td><%=entity.getProductID()%></td>
                                                </tr>
                                                <tr>
                                                    <td>Name: </td><td><%=entity.getProductName()%></td>
                                                </tr>
                                                <tr>
                                                    <td>Price: </td><td><%=entity.getUnitPrice()%></td>
                                                </tr>
                                            </table>
                                        </div>

                                        <%}
                                        %>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- others frames-->
                    <div class="frame bg-color-red fg-color-lighten" id="frame2">  
                        <div class="page-region">
                                <div class="page-region-content" style="height: 100%">
                                    <div class="grid" style="padding-left: 10px">
                                        <div class="row">
                                        <%
                                            ob = session.getAttribute("orders");
                                            if (ob == null) {
                                                Collection<Order> orders = new ArrayList<Order>();
                                                session.setAttribute("orders", orders);
                                            }
                                            categoryID = "2";
                                            list1 = productsTbl_Stub.listByCategoryID(categoryID);
                                            it = list1.iterator();
                                            while (it.hasNext()) {
                                                Products entity = it.next();
                                        %>
                                        <div>
                                            <table id="product" class="span3 hovered border-color-blue"  style="margin-left: 0px;margin-bottom: 20px; margin-top: 20px;">
                                                <tr>
                                                    <td colspan="2">
                                                        <a href="ViewProductDetails.jsp?productId=<%=entity.getProductID()%>">
                                                            <img src=<%=entity.getProductImage()%> class="imgOpa" height="160px" width="160px"></a>
                                                    </td>                                            
                                                </tr>
                                                <tr>
                                                    <td>ID: </td><td><%=entity.getProductID()%></td>
                                                </tr>
                                                <tr>
                                                    <td>Name: </td><td><%=entity.getProductName()%></td>
                                                </tr>
                                                <tr>
                                                    <td>Price: </td><td><%=entity.getUnitPrice()%></td>
                                                </tr>
                                            </table>
                                        </div>

                                        <%}
                                        %>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="frame bg-color-blueLight" id="frame3"> 
                    <div class="page-region">
                                <div class="page-region-content" style="height: 100%">
                                    <div class="grid" style="padding-left: 10px">
                                        <div class="row">
                                        <%
                                            ob = session.getAttribute("orders");
                                            if (ob == null) {
                                                Collection<Order> orders = new ArrayList<Order>();
                                                session.setAttribute("orders", orders);
                                            }
                                            categoryID = "3";
                                            list1 = productsTbl_Stub.listByCategoryID(categoryID);
                                            it = list1.iterator();
                                            while (it.hasNext()) {
                                                Products entity = it.next();
                                        %>
                                        <div>
                                            <table id="product" class="span3 hovered border-color-darken"  style="margin-left: 0px;margin-bottom: 20px; margin-top: 20px;">
                                                <tr>
                                                    <td colspan="2">
                                                        <a href="ViewProductDetails.jsp?productId=<%=entity.getProductID()%>">
                                                            <img src=<%=entity.getProductImage()%> class="imgOpa" height="160px" width="160px"></a>
                                                    </td>                                            
                                                </tr>
                                                <tr>
                                                    <td>ID: </td><td><%=entity.getProductID()%></td>
                                                </tr>
                                                <tr>
                                                    <td>Name: </td><td><%=entity.getProductName()%></td>
                                                </tr>
                                                <tr>
                                                    <td>Price: </td><td><%=entity.getUnitPrice()%></td>
                                                </tr>
                                            </table>
                                        </div>

                                        <%}
                                        %>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="frame bg-color-yellow" id="frame4"> 
                    <div class="page-region">
                                <div class="page-region-content" style="height: 100%">
                                    <div class="grid" style="padding-left: 10px">
                                        <div class="row">
                                        <%
                                            ob = session.getAttribute("orders");
                                            if (ob == null) {
                                                Collection<Order> orders = new ArrayList<Order>();
                                                session.setAttribute("orders", orders);
                                            }
                                            categoryID = "4";
                                            list1 = productsTbl_Stub.listByCategoryID(categoryID);
                                            it = list1.iterator();
                                            while (it.hasNext()) {
                                                Products entity = it.next();
                                        %>
                                        <div>
                                            <table id="product" class="span3 hovered border-color-darken"  style="margin-left: 0px;margin-bottom: 20px; margin-top: 20px;">
                                                <tr>
                                                    <td colspan="2">
                                                        <a href="ViewProductDetails.jsp?productId=<%=entity.getProductID()%>">
                                                            <img src=<%=entity.getProductImage()%> class="imgOpa" height="160px" width="160px"></a>
                                                    </td>                                            
                                                </tr>
                                                <tr>
                                                    <td>ID: </td><td><%=entity.getProductID()%></td>
                                                </tr>
                                                <tr>
                                                    <td>Name: </td><td><%=entity.getProductName()%></td>
                                                </tr>
                                                <tr>
                                                    <td>Price: </td><td><%=entity.getUnitPrice()%></td>
                                                </tr>
                                            </table>
                                        </div>

                                        <%}
                                        %>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <%@include file="footer.html" %>
        </div>
</html>
